main(){
echo "sqlldr userid=$1/$2@$5 control=$3 log=$4 rows=10000 bindsize=2560000"
sqlldr userid=$1/$2@$5 control=$3 log=$4 rows=10000 bindsize=2560000
errorLine=1
success=`cat $4 |grep ".*[0-9] Rows successfully loaded.*"|awk -F " " '{print $1}'`
dataerror=`cat $4 |grep  ".*[0-9] Rows not loaded due to data errors.*"|awk -F " " '{print $1}'`
whenerror=`cat $4 |grep  ".*[0-9] Rows not loaded because all WHEN clauses were failed.*"|awk -F " " '{print $1}'`
nullerror=`cat $4 |grep  ".*[0-9] Rows not loaded because all fields were null..*"|awk -F " " '{print $1}'`
errorLine=`expr $dataerror + $whenerror + $nullerror`
echo "$errorLine line not loaded ,$success line loaded"
cat $4
if [ $errorLine -ne 0 ]; then
	echo "Oracle Load Failed!"
	return 1;
else
	echo "Oracle Load Suceessed"
	return 0;
fi
}

main $1 $2 $3 $4 $5
